package com.wangzefeng.nacos.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Auther: wangzefeng
 * @Date: 2021/3/11 11:43
 * @Description:
 */
@RestController
@RequestMapping("/goods")
public class GoodsController {

    @Value("${server.port}")
    private String serverPort;

    @GetMapping("/one")
    public Map<String,Object> getOneGood(){
        Map<String, Object> map = getMap();
        map.put("code",200);
        map.put("data","电脑");
        map.put("port",serverPort);
        return map;
    }


    private Map<String,Object> getMap(){
        return new HashMap<>();
    }
}
